//
//  ReversiGameResultController.m
//  Reversi
//
//  Created by 成瀬 龍人 on 2/10/10.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import "ReversiGameResultController.h"


@implementation ReversiGameResultController
- (void)windowDidBecomeKey:(NSNotification *)notification{
	if ([reversiController isBlackWin]){
		[resultField setStringValue:@"you win!"];
	}else if ([reversiController isWhiteWin]){
		[resultField setStringValue:@"you lose!"];
	}else{
		[resultField setStringValue:@"draw."];
	}
}

- (IBAction)ok:(id)sender{
	[gameResultPanel orderOut:self];
	[[NSApplication sharedApplication]
	 endSheet:gameResultPanel];
	[reversiController openInitializeWindow:self];
}

- (IBAction)cancel:(id)sender{
	[gameResultPanel orderOut:self];
	[[NSApplication sharedApplication]
	 endSheet:gameResultPanel];
}
@end
